<%-- 
    Document   : vancancy_update
    Created on : Feb 10, 2012, 11:42:45 PM
    Author     : SonLT
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
        <link rel="stylesheet" type="text/css" href="./css/webstarter.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.17.custom.css" />
        <link rel="stylesheet" type="text/css" href="./css/superfish.css" />
        <link rel="stylesheet" type="text/css" href="./css/jquery.wysiwyg.css" />
        <link rel="stylesheet" type="text/css" href="./css/fullcalendar.css" />
        <style type="text/css">
            input[type="text"]{border: 1px solid #aaaaaa; height: 21px;}
            input[type="text"]:focus{background: #ffc;}
            input[type="password"]{border: 1px solid #aaaaaa; height: 21px;}
            input[type="password"]:focus{background: #ffc;}
        </style>

        <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
        <script type="text/javascript" src="js/additional-methods.js"></script>
        <script type="text/javascript" src="js/jquery.validate.js"></script>

        <script type="text/javascript">

            $(document).ready(function(){
                $("#txtStartdate").datepicker();
                $("#txtClosedate").datepicker();
            });

            $(function() {

                $("#insert").validate({
                    rules:{
                        txtvacancyID: {
                            required:true
                        },
                        txtvacancyTitle: {
                            required:true
                        },
                        txtNumOfJob: {
                            required:true,
                            digits:true
                        },
                        txtSalary: {
                            required:true
                        },
                        txtExperience: {
                            required:true
                        },
                        txtStartdate: {
                            required:true
                        },
                        txtClosedate: {
                            required:true
                        },
                        txtStatus: {
                            required:true
                        },
                        txtImages:{
                            required:true
                        }
                    }
                })

            });

        </script>
    </head>
    <body>
        <jsp:include page="include/header.jsp"/>
        <div id="content">

            <div class="dataGrid">

                <div id="testForm" title="Create new user" style="margin-left: 200px; margin-top: 30px;">
                    <!--  <p class="validateTips" style="width: 300px; text-align: left;">All form fields are required.</p>-->
                    <html:form styleId="insert" action="administrator/vacancyUpdate.do" method="post">
                        <fieldset style="width: 400px; text-align: left;">
                            <legend style="margin-bottom: 15px; font-size: 12px; font-weight: bolder;">Update vacancy</legend>

                            Vacancy id:<br>
                            <input type="text" name="txtvacancyID" value="${vac.vacancyID}" style="width: 200px; margin-bottom: 20px;background-color: #aaaaaa" readonly="true"/><br>
                            Department:<br>
                            <jsp:useBean id="va" class="model.VacancyModel"/>
                            <select name="cbxDepartment">                                
                                <jsp:useBean id="de" class="model.DepartmentModel"/>
                                <c:forEach var="d" items="${de.allDepartment}">
                                    <option value="${d.departmentid}" <c:if test="${vac.departmentID == d.departmentid}">selected="true"</c:if>>
                                        ${d.departmentname}</option>
                                    </c:forEach>
                            </select><br/><br>
                            Vacancy title:<br>
                            <input type="text" name="txtvacancyTitle" value="${vac.vacancyTitle}" style="width: 200px; margin-bottom: 20px;"/><br>
                            Num Of Job:<br>
                            <input type="text" name="txtNumOfJob" value="${vac.numOfJob}"  style="width: 200px; margin-bottom: 20px;"/><br>
                            Salary:<br>
                            <select name="txtSalary" id="txtExperience">
                                <option value="${vac.salary}">${vac.salary}</option>
                                <option value="250 - 300 $">250 - 300 $</option>
                                <option value="300 - 500 $">300 - 500 $</option>
                                <option value="1000 - 1500 $">1000 - 1500 $</option>
                                <option value="Salary agreement">Salary agreement</option>
                                <option value="Probationary">Probationary</option>                                
                            </select><br/><br>
                            Experience:<br>
                            <select name="txtExperience" id="txtExperience">
                                <option value="${vac.experience}">${vac.experience}</option>
                                <option value="1 year">1 year</option>
                                <option value="2 years">2 years</option>
                                <option value="3 years">3 years</option>
                                <option value="No required">No required</option>
                            </select><br/><br>
                            Start Date:<br>
                            <input type="text" name="txtStartdate" id="txtStartdate" value="${vac.startDate}" id="txtStartdate" style="width: 200px; margin-bottom: 20px;"/><br>
                            Close Date:<br>
                            <input type="text" name="txtClosedate" id="txtClosedate" value="${vac.closeDate}" id="txtClosedate" style="width: 200px; margin-bottom: 20px;"/><br>
                             Place:<br>
                            <input type="text" name="txtPlace" value="${vac.place}" id="txtPlace" style="width: 200px; margin-bottom: 20px;"/><br>
                            Status:<br>
                            <select name="txtStatus">
                                <option value="${vac.status}">${vac.status}</option>
                                <option value="Open">Open</option>
                                <option value="Close">Close</option>
                                <option value="Suspended">Suspended</option>
                            </select><br/><br>
                            
                            <input type="submit" id="submit" name="submit" value="Update"/>
                            <input type="reset" id="reset" name="reset" value="Clear"/>
                        </fieldset>

                    </html:form>
                </div>



            </div>

        </div><!-- END OF #content -->
        <jsp:include page="include/footer.jsp"/>
    </body>
</html>
